# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudSupport.V2.Model.Comment do
  @moduledoc """
  A comment associated with a support case. Case comments are the primary way for Google Support to communicate with a user who has opened a case. When a user responds to Google Support, the user's responses also appear as comments.

  ## Attributes

  *   `body` (*type:* `String.t`, *default:* `nil`) - The full comment body. Maximum of 12800 characters.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the comment was created.
  *   `creator` (*type:* `GoogleApi.CloudSupport.V2.Model.Actor.t`, *default:* `nil`) - Output only. The user or Google Support agent who created the comment.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Identifier. The resource name of the comment.
  *   `plainTextBody` (*type:* `String.t`, *default:* `nil`) - Output only. DEPRECATED. DO NOT USE. A duplicate of the `body` field. This field is only present for legacy reasons.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :body => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :creator => GoogleApi.CloudSupport.V2.Model.Actor.t() | nil,
          :name => String.t() | nil,
          :plainTextBody => String.t() | nil
        }

  field(:body)
  field(:createTime, as: DateTime)
  field(:creator, as: GoogleApi.CloudSupport.V2.Model.Actor)
  field(:name)
  field(:plainTextBody)
end

defimpl Poison.Decoder, for: GoogleApi.CloudSupport.V2.Model.Comment do
  def decode(value, options) do
    GoogleApi.CloudSupport.V2.Model.Comment.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudSupport.V2.Model.Comment do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
